﻿// test_12.3.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
void r1(char* str, int start, int end)
{
	end--;
	while (end > start)
	{
		char tmp = str[start];
		str[start] = str[end];
		str[end] = tmp;
		end--;
		start++;
	}
}
void r2(char* str)
{
	int start = 0;
	int end = 0;
	while (str[start] != '\0')
	{
		while (str[end] != '\0' && str[end] != ' ')
		{
			end++;
		}
		r1(str, start, end);
		if (str[end] != '\0')
		{
			start = end + 1;
		}
		else
		{
			
				start = end;
		}
		end++;
	}
}
int main()
{
	char str[100] = { 0 };
	fgets(str, 100, stdin);
	str[strlen(str) - 1] = '\0';
	int n = strlen(str);
	r1(str, 0, n);
	r2(str);
	printf("%s", str);
	return 0;
}




